package com.twu.bibilioteca;

import junit.framework.TestCase;
import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;

/**
 * Created by IntelliJ IDEA.
 * User: dixithk
 * Date: 6/20/14
 * Time: 12:51 PM
 * To change this template use File | Settings | File Templates.
 */
public class CheckOutMovieTest {


    Library lib =new Library();
       @Before
        public void loadMovies()
       {
           lib.loadMovies();

       }

    @Test
    public void shouldCheckForValidCheckOutMovie()
    {

        Result c= new CheckOutMovie(new UserInterfaceTest("manam") , lib).action();
        assertEquals(new Result("Thank you Enjoy the movie at Home  " , true) , c) ;
    }

    @Test
    public void shouldCheckForInValidCheckOutMovie()
    {

        Result c= new CheckOutMovie(new UserInterfaceTest("Swades") , lib).action();
        assertEquals(new Result("That movie is not available."  , false) , c) ;
    }


    @Test

    public void shouldCheckJobOfClass()
    {

        assertEquals(new CheckOutMovie(new UserInterfaceApp(), lib).getName() ,"check out a Movie");
    }
}
